Bezier Curves
What if you need something smoother than a line of straight segments?
Bezier curves? We got 'em
Perhaps we can use this to make smoothly curved corners for a frame
Note : framed is a Layout that takes three arguments :
- a list of corner pieces (which it reflects appropriately),
- a list of edge pieces (which it rotates appropriately)
- and a single centre (NOT a list, just a single group which it fills the middle.)
Framed can be used to generate various bordered patterns
Which can be tiled together with grid-layout
Random transformations
Note how we fill grids from lazy, infinite lists of shapes made with repeat.
We can map other functions to these streams, for example to randomly rotate them.
We can increase the complexity of the pattern, mixing streams of various sub-patterns.
For more information on transforming streams of sub-patterns with functional programming tools, see Functional Power for Patterning
A word about colour.
Colours can be defined with the function p-color which takes 1, 3 or 4 arguments. A single argument will give you a shade of grey between black (0) and white (255). Three arguments will get mapped to red, green and blue components. Four arguments will get mapped to red, green, blue and alpha (transparency) components.
A transparent green :
(p-color 150 255 150 150)
We can over-ride or supplement the styling of an existing group using the over-style function. Here we're going to supplement an already bright green clock-rated drunk-line with a transparent green fill. Note that the drunk-line is not closed but can still be filled.
And to see the transparency we can stack it on top of a basic grid of squares. (This may not work in all browsers.)